package com.yc.cloud.api.enums;

/**
 * 算法检测类别枚举
 * 
 * @author kinggu
 * @since 2025-01-XX
 */
public enum AlgorithmDetectionTypeEnum {
    
    /**
     * 目标检测 - 检测到目标才报警（如：人员违规吸烟、安全帽检测等）
     */
    TARGET_DETECTION(0, "目标检测"),
    
    /**
     * 场景检测 - 未检测到目标才报警（如：脱岗检测、灭火器站位检测等）
     */
    SCENE_DETECTION(1, "场景检测");
    
    private final Integer value;
    private final String description;
    
    AlgorithmDetectionTypeEnum(Integer value, String description) {
        this.value = value;
        this.description = description;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 根据值获取枚举
     */
    public static AlgorithmDetectionTypeEnum getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (AlgorithmDetectionTypeEnum type : values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }
    
    /**
     * 是否为目标检测类型
     */
    public boolean isTargetDetection() {
        return this == TARGET_DETECTION;
    }
    
    /**
     * 是否为场景检测类型
     */
    public boolean isSceneDetection() {
        return this == SCENE_DETECTION;
    }
}
